package com.yilife.hmstr.controller;

import com.yilife.hmstr.domain.tr;
import com.yilife.hmstr.service.impl.TestReportServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tr")
@Api(description = "检测报告数据的增删改查")
public class TestReportController {
	
	@Autowired
	private TestReportServiceImpl trsImpl;
	
//	@RequestMapping("/add")
//	public void add(){
//		TestReport testReport=new TestReport(1232, 21322);
//		List<MeridianChangeAnalysis> meridianChangeAnalysis=new ArrayList<MeridianChangeAnalysis>();
//		MeridianChangeAnalysis mca1=new MeridianChangeAnalysis(321, 1232, 1, "经络变化", "提示疾病");
//		MeridianChangeAnalysis mca2=new MeridianChangeAnalysis(322, 1232, 2, "经络变化", "提示疾病");
//		meridianChangeAnalysis.add(mca2);
//		meridianChangeAnalysis.add(mca1);
//		List<TrProblem> trProblems=new ArrayList<TrProblem>();
//		TrProblem tr1=new TrProblem(1, "项目", "建议", "属性", 1232);
//		trProblems.add(tr1);
//		trsImpl.add(testReport, meridianChangeAnalysis, trProblems);
//	}
//
//	@RequestMapping("/del")
//	public void del(){
//		trsImpl.del(1232);
//	}
//
//
//	@RequestMapping("/up")
//	public void update(){
//		TestReport testReport=new TestReport();
//		testReport.setTrId(1232);
//	}
	@RequestMapping(value = "/del",method = RequestMethod.DELETE)
	@ApiOperation(value = "根据健康管理系统检测报告id删除检测报告数据")
	public void del(@RequestBody Long hmstrId){
		trsImpl.delByPid(hmstrId);
	}

	@RequestMapping(value="/sel",method = RequestMethod.GET)
	@ApiOperation(value = "根据健康管理系统检测报告id查询检测报告数据")
	public tr select(@RequestParam Long hmstrId){
		return trsImpl.selectByPid(hmstrId);
	}
}
